import getApiData, { getApisData } from "@/services/cpasRequest";

// 更新 BB_ReportIntercourse
export async function updateBB_ReportInter_zl(
    dbname: string,
    paramsData: any[],
) {
    const postData = {
        apis: [
            {
                name: 'sqlApi.update',
                params: { name: `[${dbname}]..BB_ReportIntercourse_zl`, rows: paramsData }
            },
        ],
        reload: true,
        params: {}
    }
    const resApis = await getApisData(postData);
    const resUpdate = resApis.data['sqlApi.update']
    if (resApis.ok && resUpdate.ok) {
        return Promise.resolve({
            data: 'BB_ReportIntercourse, 更改信息成功！',
            success: true,
        });
    }
    return Promise.resolve({
        data: resApis.data,
        success: false,
    });
}



export async function getNbwltjListData(params: {
    dbname: string;
    isQM: boolean
}) {
    if (!params.dbname) return [];
    const res = await getApiData('account.nbwltj_colList', params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: res.data,
        success: false,
    });
}